<template>
  <div>
    <el-table
      ref="customerTable"
      :data="tableData"
      stripe
      border
      style="width: 100%"
      @selection-change="getSelectVal"
    >
      <el-table-column type="selection" width="55" align="center">
      </el-table-column>
      <el-table-column prop="deptName" label="收料组织"></el-table-column>
      <el-table-column prop="customerName" label="客户名称"></el-table-column>
      <el-table-column prop="docNo" label="单据编号"> </el-table-column>
      <el-table-column prop="currencyName" label="币别名称"></el-table-column>
      <el-table-column
        prop="settlementTitle"
        label="结算方式"
      ></el-table-column>
      <el-table-column prop="totalTaxAmount" label="价税合计"></el-table-column>
      <el-table-column prop="userName" label="销售员"></el-table-column>
      <el-table-column prop="createTime" label="创建时间"></el-table-column>
    </el-table>
    <el-pagination
      class="pagination mt10"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[10, 20, 30, 40]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
      background
    >
    </el-pagination>
    <!-- <div>
      <el-button size="small" type="primary" @click="submit">确定</el-button>
      <el-button
        size="small"
        type="primary"
        @click="$emit('update:visible', false)"
        >取消</el-button
      >
    </div> -->
  </div>
</template>

<script>
import { listInfo } from "@/api/finance/saleInvoice";
export default {
  data() {
    return {
      tableData: [],
      currentPage: 1, //当前页
      pageSize: 10, //每页条数
      total: 0,
      val: [],
    };
  },
  methods: {
    submit() {
      // this.$emit("update:visible", false);
    },
    //分页器size
    handleSizeChange(val) {
      this.pageSize = val;
      this.getDataList();
    },
    //分页器当前页
    handleCurrentChange(val) {
      this.currentPage = val;
      this.getDataList();
    },
    getSelectVal(val) {
      this.$emit("getSelectVal", val);
    },
    getDataList() {
      listInfo({
        limit: this.pageSize,
        page: this.currentPage,
      }).then((res) => {
        this.tableData = res.rows;
        this.total = res.total;
      });
    },
  },
  mounted() {
    this.getDataList();
  },
};
</script>

<style></style>
